Data calculations in electronic circuits are commonly implemented by modulo arithmetic. In an abstract mathematical sense, "modulo M" arithmetic uses a number system to the base M where each digit of the number system is represented by a predetermined value within a range from 0 thru (M-1), where M is an integer. A representation of "(N)modulo M" is essentially equal to the "remainder" of N to the base M. For example, the representation (12) modulo 10 is equal to two. As calculations of (R.+-.N)modulo M are performed on numbers R and N which each are within a range from 0 thru (M-1), the resultant must also be a number within the defined range. If a lower boundary value, L, of the range is not equal to zero, a modulo value resulting from an arithmetic calculation is no longer literally equal to a remainder value. The resultant is offset from 0 by the value of the lower boundary L and the modulo arithmetic calculation becomes equal to: EQU [(R.+-.N-L)modulo M]+L.
Modulo arithmetic is commonly used in signal processing and data processors to perform address calculations. The address calculations are performed on integer values to access data in data storage devices. Data storage devices are typically implemented by conventional memory circuits having linear addressing capability. Linear arithmetic is an arithmetic form commonly found in data processors and is typically implemented by conventional two's complement binary arithmetic. However, linear arithmetic does not directly implement data structures in memory, such as circular buffers, queues or FIFOs. This is because linear arithmetic provides no capability of performing a "wraparound" operation to maintain an address within a defined range. In contrast, modulo arithmetic directly implements these types of data structures in conventional memory circuits by providing a wraparound operation with no overhead. Therefore, it is often desirable to use modulo addressing to create these useful data structures.
Modulo addressing is typically implemented with software using linear arithmetic. Typical microprocessors use linear addressing to implement modulo addressing. A circular buffer or a queue is typically implemented by incrementing an address pointer by an offset value and using a comparator for comparing each successive increment value with a first boundary value. When the first boundary value is reached, a second boundary value representing the wraparound value is provided so that the resultant remains within a predetermined range. This type of addressing is also known in the literature as "circular buffer addressing", "queue addressing" and "FIFO addressing". However, implementation of modulo addressing using linear arithmetic typically requires a minimum of four software instructions per data access. Therefore, a large amount of overhead exists when frequently accessing such data structures.